﻿<local:DocumentBase x:Class="WPFExcelReport.JLTAB55"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                          xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR" 
                     xmlns:ABF="clr-namespace:WPFExcelReport;assembly=TABFOLGE" 
                    xmlns:AB="clr-namespace:WPFExcelReport;assembly=TABPOS" 
                    xmlns:WB="clr-namespace:WPFExcelReport;assembly=TWBBST" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
                    xmlns:WT="clr-namespace:WPFExcelReport;assembly=TWTSAER"  
                    xmlns:WG="clr-namespace:WPFExcelReport;assembly=TWASTGA"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"    
                    Name="TV"
                    FontSize="16"
                    Loaded="Window_Loaded" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="329">
    <local:DocumentBase.Resources>
        <ucd:PNumConverter  x:Key="pnum"/>
    </local:DocumentBase.Resources>
    <Grid> 
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="100"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" >
            <WrapPanel >
                <Label Content="织造单号：" HorizontalAlignment="Left" Margin="5,5,0,0" Name="label3" VerticalAlignment="Top" Width="84" FontSize="16" />
                <TextBox Name="txtKRS"  Width="32" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="WhiteSmoke" Panel.ZIndex="1"
                         Text="ZZ" KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="2" FontSize="18" Foreground="#FF141111" />
                <TextBox Name="txtLFD" Width="87" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="Pink" Panel.ZIndex="2"
                         Text="" KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="6" FontSize="18" Foreground="#FF141111"  />
                <TextBox Name="txtPOS" Width="36" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="WhiteSmoke" Panel.ZIndex="3"
                         Text="1" KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="3" FontSize="18" Foreground="#FF141111"  />
                <Button Content="查询" Height="33" Margin="10,0,0,0"  Name="btnQuery" Width="71" Panel.ZIndex="6"
                        Click="btnQuery_Click"/>
                <Button Content="打印织造上机单"   Margin="10,0,0,0"  Name="btnEXCEL" Width="135" Panel.ZIndex="7"
                        Click="btnEXCEL_Click"/>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <DR:TDRAUFTR  Grid.Column="0" Name="cDR" DocType="JLTAB55B"
                                  Visibility="Collapsed" PrintType="OpenExcel" />
                    <Button  Grid.Column="1"   Click="btnBARCODE_Click" Height="20" Margin="5,0,0,0" Width="Auto" 
                             Content="{Binding Source={Localization:Translate Word=打印坯布标签}}" />
                </Grid> 
            </WrapPanel>
        </StackPanel>

        <DataGrid  Margin="0,1,0,0"  FontSize="12"  Grid.Column="0" Grid.ColumnSpan="2" 
            Grid.Row="1"
                CanUserReorderColumns="True"  
                CanUserResizeRows="True" CanUserSortColumns="True"                  
                AutoGenerateColumns="False"   
                EnableRowVirtualization="True" 
                RowDetailsVisibilityMode="VisibleWhenSelected"  
                IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                ItemsSource="{Binding}" x:Name="MasterDg" >
            <DataGrid.Columns>
                    <!--WVORDER	ARTICLE	CO	ORDQTY	ALLQTY	ABPANZSTK	PQTY	ABPSTARTDAT	ABPENDDAT	
                FDDIK	FDDIS	DES	STR	YARN	BEAM	MACHINE -->
                    <DataGridTextColumn Header="织造单" Binding="{Binding WVORDER}" Width="Auto"/>
                    <DataGridTextColumn Header="小花型号" Binding="{Binding ARTICLE}" Width="Auto"/>
                    <DataGridTextColumn Header="任务书" Binding="{Binding CO}" Width="Auto"/>
                    <DataGridTextColumn Header="订单数量" Binding="{Binding ORDQTY}" Width="Auto"/>
                    <DataGridTextColumn Header="目标匹数" Binding="{Binding ABPANZSTK}" Width="Auto"/>
                    <DataGridTextColumn Header="目标匹长" Binding="{Binding PQTY}" Width="Auto"/>
                    <DataGridTextColumn Header="计划上机" Binding="{Binding ABPSTARTDAT}" Width="Auto"/>
                    <DataGridTextColumn Header="计划下机" Binding="{Binding ABPENDDAT}" Width="Auto"/>
                    <DataGridTextColumn Header="坯布经密" Binding="{Binding FDDIK}" Width="Auto"/>
                    <DataGridTextColumn Header="坯布纬密" Binding="{Binding FDDIS}" Width="Auto"/>
                    <DataGridTextColumn Header="品种名称" Binding="{Binding DES}" Width="Auto"/>
                    <DataGridTextColumn Header="组织" Binding="{Binding STR}" Width="Auto"/>
                    <DataGridTextColumn Header="纱支" Binding="{Binding YARN}" Width="Auto"/>
                    <DataGridTextColumn Header="轴号" Binding="{Binding BEAM}" Width="Auto"/>
                    <DataGridTextColumn Header="轴长" Binding="{Binding ALLQTY}" Width="Auto"/>
                    <DataGridTextColumn Header="机台号" Binding="{Binding MACHINE}" Width="Auto"/>
            </DataGrid.Columns>
        </DataGrid  >


        <DataGrid  Margin="0,1,0,0"   Grid.Row="2"  Grid.Column="0" Grid.ColumnSpan="2" 
            FontSize="12"  
                CanUserReorderColumns="True"  
                CanUserResizeRows="True" CanUserSortColumns="True"                  
                AutoGenerateColumns="False"   
                EnableRowVirtualization="True" 
                RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                ItemsSource="{Binding}" x:Name="dlDg" >
            <DataGrid.Columns>
                    <!--WBBSTKNR	ART	PQTY	IQTY -->
                    <DataGridTextColumn Header="布卷号" Binding="{Binding WBBSTKNR}" Width="Auto"/>
                    <DataGridTextColumn Header="花型号" Binding="{Binding ART}" Width="Auto"/>
                    <DataGridTextColumn Header="计划长度" Binding="{Binding PQTY}" Width="Auto"/>
                    <DataGridTextColumn Header="实际长度" Binding="{Binding IQTY}" Width="Auto"/>
            </DataGrid.Columns>
        </DataGrid  >
        <Expander Grid.Row="3" Grid.Column="0" IsExpanded="True" >
            <Expander.Header>
                <TextBlock Text="{Binding INFO,ElementName=cWTW}"/>
            </Expander.Header>
            <WT:TDWT15     Name="cWTW"
                           IsCanLoad="True"
                          ORDERNUM="{Binding WPATTERN,ElementName=TV}"
                ></WT:TDWT15>
        </Expander>
        <Expander Grid.Row="3" Grid.Column="1" IsExpanded="True" >
            <Expander.Header>
                <TextBlock Text="{Binding INFO,ElementName=cWTF}"/>
            </Expander.Header>
            <WT:TDWT15
                Name="cWTF"
                IsCanLoad="True"
                 ORDERNUM="{Binding FPATTERN,ElementName=TV}"
                ></WT:TDWT15>
        </Expander>
        <Expander  Grid.Row="4" Grid.Column="1" >
            <Expander.Header>
                <TextBlock Text="{Binding INFO,ElementName=cWS33}"/>
            </Expander.Header>
            
            <WG:TWS33  EXAUF="{Binding ARTICLE,ElementName=TV}" Name="cWS33">                
            </WG:TWS33>
        </Expander>
    </Grid>
        
</local:DocumentBase>
